package com.tinem.platform.module.starter.jpa.entity.link;

import com.tinem.platform.module.pojo.enums.message.ResourceType;
import com.tinem.platform.module.pojo.enums.web.LinkType;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * @author fzh
 * @version v1
 * @program: platform
 * @className LinkEvent
 * @description 链接事件
 * @site
 * @company
 * @create 2022-1-16
 */
@Data
@Entity
@ToString
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode
@NoArgsConstructor
@AllArgsConstructor
@Table(name="t_link_event")
@ApiModel("链接事件")
public class LinkEvent implements Serializable,Cloneable{
    @Id
    @Column(name = "c_id",nullable=true)
    @ApiModelProperty(name = "id", value = "编号",required = true)
    private String id;

    @Column(name = "c_link_id",nullable=true)
    @ApiModelProperty(name = "linkId", value = "链接编号",required = true)
    private String linkId;

    @Enumerated(EnumType.STRING)
    @Column(name = "c_link_type",nullable=true)
    @ApiModelProperty(name = "linkType", value = "链接类型",required = true)
    private LinkType linkType;

    @Column(name = "c_client_id",nullable=true)
    @ApiModelProperty(name = "clientId", value = "客户端渠道编号",required = true)
    private String clientId;

    @Enumerated(EnumType.STRING)
    @Column(name = "c_resource_type",nullable=true)
    @ApiModelProperty(name = "resourceType", value = "资源类型",required = true)
    private ResourceType resourceType;

    @Column(name = "c_referer",nullable=true)
    @ApiModelProperty(name = "referer", value = "事件来源",required = true)
    private String referer;

    @Column(name = "c_resource_id",nullable=true)
    @ApiModelProperty(name = "resourceId", value = "资源编号",required = true)
    private String resourceId;

    @Column(name = "c_event_time",nullable=true)
    @ApiModelProperty(name = "eventTime", value = "事件时间",required = true)
    private Date eventTime;

    @Column(name = "c_event_ip",nullable=true)
    @ApiModelProperty(name = "eventIp", value = "事件ip地址",required = true)
    private String eventIp;

    @Column(name = "c_event_ua",nullable=true)
    @ApiModelProperty(name = "eventUa", value = "事件ua",required = true)
    private String eventUa;

    @Column(name = "c_event_client_browser",nullable=true)
    @ApiModelProperty(name = "eventClientBrowser", value = "浏览器",required = true)
    private String eventClientBrowser;

    @Column(name = "c_event_client_browser_version",nullable=true)
    @ApiModelProperty(name = "eventClientBrowserVersion", value = "浏览器版本",required = true)
    private String eventClientBrowserVersion;

    @Column(name = "c_event_client_os",nullable=true)
    @ApiModelProperty(name = "eventClientOs", value = "客户端操作系统",required = true)
    private String eventClientOs;

    @Column(name = "c_event_client_platform",nullable=true)
    @ApiModelProperty(name = "eventClientPlatform", value = "客户端平台",required = true)
    private String eventClientPlatform;

    @Version
    @Column(name = "c_revision",nullable=true)
    @ApiModelProperty(name = "revision", value = "乐观锁",required = false)
    private Integer revision;

    @Column(name = "c_created_by",nullable=true)
    @ApiModelProperty(name = "createdBy", value = "创建人",required = false)
    private String createdBy;

    @Column(name = "c_created_time",nullable=true,insertable = false,updatable = false)
    @ApiModelProperty(name = "createdTime", value = "创建时间",required = false)
    private Date createdTime;

    @Column(name = "c_updated_by",nullable=true)
    @ApiModelProperty(name = "updatedBy", value = "更新人",required = false)
    private String updatedBy;

    @Column(name = "c_updated_time",nullable=true,insertable = false,updatable = false)
    @ApiModelProperty(name = "updatedTime", value = "更新时间",required = false)
    private Date updatedTime;

}